package com.erp.utils;

import java.util.Properties;

public class OSUtils {
    /**
     * 判断是否是Linux
     * @return
     */
    public static boolean isOSLinux() {
        Properties prop = System.getProperties();
        String os = prop.getProperty("os.name");
        if (os != null && os.toLowerCase().indexOf("linux") > -1) {
            return true;
        } else {
            return false;
        }
    }

        /**
         * 判断是否是windows
         * @return
         */
    public static boolean isOSWin() {
        Properties prop = System.getProperties();
        String os = prop.getProperty("os.name");
        if (os != null && os.toLowerCase().startsWith("win")) {
            return true;
        } else {
            return false;
        }
    }

    /**
     * windows系统获取home目录
     * @return
     */
    public static  String getHome(){
        String userHome = System.getProperty("user.home");//用户的主目录System.out.println("userHome:   "+userHome);
        return userHome+"/";
    }
}
